const axios = require('axios');

const request = axios.create({
  //   baseURL: 'https://some-domain.com/api/',
  timeout: 10000,
});

// 请求拦截器
request.interceptors.request.use(
  function (config) {
    return config;
  },
  function (error) {
    return Promise.reject(error);
  }
);

// 响应拦截器
request.interceptors.response.use(
  function (response) {
    return response;
  },
  function (error) {
    return Promise.reject(error);
  }
);

module.exports = request;
